package demo1;

import java.util.Arrays;

public class Main1{
    public static void main(String[] args) {
        student student1 = new student("1",1);
        student student2 = new student("2",1);
        student student3 = new student("3",2);

        if(student1.equals(student2)){
            System.out.println("Yes");
        }else {
            System.out.println("No");
        }

        if(student1.equals(student3)){
            System.out.println("Yes");
        }else {
            System.out.println("No");
        }

    }

    public static void Sort(Comparable[] array){
        for (int bound = 0; bound < array.length; bound++) {
            for (int cur = array.length - 1; cur > bound; cur--) {
                if (array[cur - 1].compareTo(array[cur]) > 0) {
                    Comparable tmp = array[cur - 1];
                    array[cur - 1] = array[cur];
                    array[cur] = tmp;
                }
            }
        }
    }
}


class student implements Comparable {
    private String name;
    private int score;

    public student(String name, int score) {
        this.name = name;
        this.score = score;
    }

    @Override
    public String toString() {
        return "student{" +
                "name='" + name + '\'' +
                ", score=" + score +
                '}';
    }

    @Override
    public int compareTo(Object o) {
        student s = (student) o;
        if (this.score > s.score) {
            return -1;
        } else if (this.score < s.score) {
            return 1;
        } else {
            return 0;
        }
    }

    @Override
    public boolean equals(Object obj) {
        if(!(obj instanceof student)){
            return false;
        }

        student student = (demo1.student) obj;

        return this.score == student.score;
    }


}

